package com.bjsxt.livegoods.details.client.controller;

import com.bjsxt.livegoods.details.client.service.DetailsService;
import com.bjsxt.livegoods.entity.Product;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 商品详情查看服务消费者 - 控制器
 */
@RestController
public class DetailsController {
    @Autowired
    private DetailsService detailsService;

    @GetMapping
    @CrossOrigin
    public Product findProductById(String id){
        return detailsService.findById(id);
    }
}
